package com.lo23.data.objgroup;

import java.util.Date;

import com.lo23.data.utils.DataUtils;
import com.lo23.data.utils.FormatConvert;
import com.lo23.data.xml.XMLData.XMLLocalUser.XMLFriendshipRequest;

public class FriendshipRequest {

	private XMLFriendshipRequest _friendshipRequest;

	/**
	 * @param friendshipRequest
	 */
	public FriendshipRequest(XMLFriendshipRequest friendshipRequest) {
		_friendshipRequest = friendshipRequest;
	}

	/**
	 * Get the friends'ID
	 * 
	 * @return the friendID
	 */
	public String getFriendID() {
		return DataUtils.nullString(_friendshipRequest.getFriendId());
	}

	/**
	 * Get the friend's Login
	 * 
	 * @return the friendLogin
	 */
	public String getFriendLogin() {
		return DataUtils.nullString(_friendshipRequest.getFriendLogin());
	}

	/**
	 * Get the date of the request
	 * 
	 * @return the date
	 */
	public Date getDate() {
		return FormatConvert.xMLGregorianCalendarToDate(_friendshipRequest.getDate());
	}

	/**
	 * Get the status of the request
	 * 
	 * @return the status
	 */
	public boolean getStatus() {
		return _friendshipRequest.isStatut();
	}

	/**
	 * Set the ID of the friend
	 * 
	 * @param FriendID
	 *            the friendID to set
	 */
	public void setFriendID(String friendID) {
		_friendshipRequest.setFriendId(friendID);
	}

	/**
	 * Set the friend's login
	 * 
	 * @param friendLogin
	 *            the friendLogin to set
	 */
	public void setFriendLogin(String friendLogin) {
		_friendshipRequest.setFriendLogin(friendLogin);
	}

	/**
	 * Set the date of the request
	 * 
	 * @param date
	 *            the date to set
	 */
	public void setDate(Date date) {
		_friendshipRequest.setDate(FormatConvert
				.dateToXMLGregorianCalendar(date));
	}

	/**
	 * Set the status of the request
	 * 
	 * @param status
	 *            the status to set
	 */
	public void setStatus(boolean status) {
		_friendshipRequest.setStatut(status);
	}

}
